package io.gitee.redismq.starter.config;

import io.gitee.redismq.comm.constant.Constant;
import io.gitee.redismq.core.config.RedisMQBanner;
import io.gitee.redismq.core.config.RedisStreamProperties;
import lombok.Data;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;

/**
 * @author: 孙浩
 * @since: 2025-03-05 10:33:20
 */
@Data
public class RedisMQMainConfig {


    @Autowired
    private RedisStreamProperties redisStreamProperties;


    /**
     * 打印banner
     */
    @EventListener
    void init(ContextRefreshedEvent event) {
        //打印banner
        if (redisStreamProperties.getIsPrint()) {
            RedisMQBanner.PrintBanner(Constant.VERSION);
        }
    }
}
